import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

    {
        path: "/login",
        component: () => import("@/views/login")
    },
    {
        path: "/",
        component: () => import("@/views/layout"),
        redirect: "/home",
        children: [
            {
                path: "home",
                component: () => import("@/views/home"),
            },
            {
                path: "qa",
                component: () => import("@/views/qa"),
            },
            {
                path: "my",
                component: () => import("@/views/my"),
            },
        ]
    },
    {
        path: "/article/:id",
        props: true,
        component: () => import("@/views/article")
    },
]

const router = new VueRouter({
    routes
})

export default router
